import { createRouter, createWebHashHistory,createWebHistory } from 'vue-router'

const routes = [
  
  // 登陆
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue'),
  },
  //首页
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    children:[
      {
        path: '/chart',
        name: 'chart',
        component: () => import('../views/two/chart')
      },
      {
        path: '/profile',
        name: 'profile',
        component: () => import('../views/two/index')
      },
      {
        path: '/user/manage',
        name: 'manage',
        component: () => import('../views/two/manage')
      },
      {
        path: '/user/role',
        name: 'role',
        component: () => import('../views/two/role')
      },
      {
        path: '/user/permission',
        name: 'permission',
        component: () => import('../views/two/permission')
      },
      {
        path: '/article/ranking',
        name: 'ranking',
        component: () => import('../views/two/ranking')
      },
      {
        path: '/article/create',
        name: 'create',
        component: () => import('../views/two/create')
      },
      {
        path: '/user/import', //导入路由
        name: 'import',
        component: () => import(/* webpackChunkName: "about" */ '../views/two/ImportView.vue')
      },
    ]
  },
 
]

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes
})

export default router
